var ClubInfoUnit = Unit.extend({
    _ccsFileName: res.ClubInfoUnit_json,
    _clubInfo: null,
    initUnit: function () {

    },
    /**
     * View基类初始化
     */
    initView: function () {
        this._actionType = ViewActionType.None;
        if (this._actionType === ViewActionType.None) {
            this._rootNode.show();
        }
        this._loadCCSFinished = true;
        this.setData.apply(this, arguments);
    },
    onEnter: function () {
        Unit.prototype.onEnter.call(this);
        this._initAllListeners();
    },
    /**
     * 监听亲友圈消息
     * @private
     */
    _initEventListeners: function () {
        this._eventListeners = {};
        this._eventListeners[ClubEvent.ClubBaseInfo] = '_clubBaseInfoHandler';
    },

    _clubBaseInfoHandler: function (clubId) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        if (!clubInfo) return;
        this._clubInfo = clubInfo;
        this._refreshView();
    },

    _refreshView: function () {
        this._nodeList['lb_id'].setString('ID:' + ellipsisStr(this._clubInfo._id));
        this._nodeList['lb_name'].setString(ellipsisStr(this._clubInfo['name'], 6));
        this._nodeList['lb_num'].setString('人数:' + this._clubInfo.players_count);
        if (this._clubInfo.onlineNum != undefined) {
            this._nodeList['lb_num2'].setString('在线:' + this._clubInfo.onlineNum);
        }
    },
});